//
//  LoginRequest.m
//  BrushFace
//
//  Created by Zzz on 15/11/29.
//  Copyright © 2015年 Zzz. All rights reserved.
//
#import "LoginRequest.h"
#import "WeChat.h"
#import "DeviceInfo.h"
@implementation LoginRequest
-(void)loadRequest
{
    [super loadRequest];
    self.PATH = @"/passport/appLoginByCode.json";
}

+ (LoginRequest *)createLoginByCodeRq
{
    NSString * accessToken = [WeChatParseHelper getAuthRsAccessToken:[WeChat sharedInstance].accessTokenRsDict];
    LoginRequest * rq = [LoginRequest Request];
    //rq.version = [DeviceInfo getAppVersion];
    rq.code = accessToken;
    rq.imie = [DeviceInfo fetchGeneralDeviceId];
    rq.tcode = @"iOS";
    //rq.timeMillis = [DeviceInfo getCurDeviceTimeStr];
    return rq;
}

+ (LoginRequest *)createTokenForAppLoginRq
{
    NSString * accessToken = [WeChatParseHelper getAuthRsAccessToken:[WeChat sharedInstance].accessTokenRsDict];
    LoginRequest * rq = [LoginRequest Request];
    rq.PATH = @"/passport/getTokenForAppLogin.json";
    rq.version = [DeviceInfo getAppVersion];
    rq.key = accessToken;
    rq.timeMillis = [DeviceInfo getCurDeviceTimeStr];
    return rq;
}

+ (LoginRequest *)createLoginByLoginKeyRq
{
    LoginRequest * rq = [LoginRequest Request];
    rq.imie = [DeviceInfo fetchGeneralDeviceId];
    rq.PATH = @"/passport/appLoginByLoginKey.json";
    return rq;
}

@end
